#include <boost/algorithm/string.hpp>
#include "EncodingMapper.h"

using namespace kc_sf;

EncodingType EncodingMapper::Map(const std::string &name)
{
	namespace ba = boost::algorithm;

	return ba::iequals(name, "7bit") ? _7Bit
			: ba::iequals(name, "8bit") ? _8Bit
			: ba::iequals(name, "binary") ? Binary
			: ba::iequals(name, "quoted-printable") ? Qp
			: ba::iequals(name, "base64") ? Base64
			: UnknownEncoding;
}
